package com.nicho.pojo;

import java.io.Serializable;

/*
 * @Author: 姜东浩
 * @Date: 2021-11-08 16:57:54
 * @LastEditors: 姜东浩
 * @LastEditTime: 2021-11-12 17:34:07
 * @Description: 课程类
 */
public class Course implements Serializable {

    // 课程编号
    private String courseId;
    // 课程名称
    private String courseName;
    // 课程讲师
    private Teacher cTeacher;
    // 课程成绩
    private double grade;
    // 课程已报人数
    private int cnum;
    // 课程可报人数
    private int snum;

    private static final long serialVersionUID = 1L;

    public Course() {
    }

    public Course(String courseId) {
        this.courseId = courseId;
    }

    public Course(String courseId, Teacher cTeacher) {
        this.courseId = courseId;
        this.cTeacher = cTeacher;
    }

    public Course(String courseId, String courseName, Teacher cTeacher) {
        this.courseId = courseId;
        this.courseName = courseName;
        this.cTeacher = cTeacher;
    }

    public Course(String courseId, String courseName, double grade) {
        this.courseId = courseId;
        this.courseName = courseName;
        this.grade = grade;
    }

    public Course(String courseId, String courseName, int snum, Teacher cTeacher) {
        this.courseId = courseId;
        this.courseName = courseName;
        this.cTeacher = cTeacher;
        this.snum = snum;
    }

    public String getCourseId() {
        return courseId;
    }

    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public double getGrade() {
        return grade;
    }

    public void setGrade(double grade) {
        this.grade = grade;
    }

    public int getCnum() {
        return cnum;
    }

    public void setCnum(int cnum) {
        this.cnum = cnum;
    }

    public int getSnum() {
        return snum;
    }

    public void setSnum(int snum) {
        this.snum = snum;
    }

    public Teacher getcTeacher() {
        return cTeacher;
    }

    public void setcTeacher(Teacher cTeacher) {
        this.cTeacher = cTeacher;
    }

    @Override
    public String toString() {
        return "Course [courseId=" + courseId + ", courseName=" + courseName + ", cTeacher=" + cTeacher + ", grade="
                + grade + ", cnum=" + cnum + ", snum=" + snum + "]";
    }

    public String toStringT() {
        return "课程编号：" + courseId + "\t" + "课程名：" + courseName;
    }

    public String toStringS() {
        return "Course [courseId=" + courseId + ", courseName=" + courseName + ", grade=" + grade + "]";
    }

    public String toStringR() {
        if (cTeacher != null) {
            return "[课程编号：" + courseId + ", 课程名称：" + courseName + ", 授课教师信息：" + cTeacher.toStringC() + ", 已报人数：" + cnum
                    + ", 可报人数：" + snum + "]";
        } else {
            return "[课程编号：" + courseId + ", 课程名称：" + courseName + ", 授课教师信息： " + ", 已报人数：" + cnum + ", 可报人数：" + snum
                    + "]";
        }

    }

}